API: widget: Remove gtk_widget_is_composited()
authorBenjamin Otte <otte@redhat.com>
Sat, 29 Oct 2016 02:48:29 +0000 (04:48 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 29 Oct 2016 02:49:47 +0000 (04:49 +0200)
We don't need to clutter our API with functions that are easily
available elsewhere and effectively unused.

docs/reference/gtk/gtk4-sections.txt
docs/reference/gtk/question_index.sgml
gtk/gtkwidget.c
gtk/gtkwidget.h
tests/testgtk.c

index 2284fc00b1a8428760f02baa14a7e469af58707c..f76eb567ab18a9e2bf73759ef07b7a845de7b0f8 100644 (file)
@@ -4739,7 +4739,6 @@ gtk_widget_get_no_show_all
 gtk_widget_list_mnemonic_labels
 gtk_widget_add_mnemonic_label
 gtk_widget_remove_mnemonic_label
-gtk_widget_is_composited
 gtk_widget_error_bell
 gtk_widget_keynav_failed
 gtk_widget_get_tooltip_markup
index 97f0b7994834de571bf0b2337b0467bd524d0dd6..34e52d647951099aa9f8f18c82606f5e8f659009 100644 (file)
@@ -570,7 +570,7 @@ RGBA drawing capabilities.
 Note that the presence of an RGBA visual is no guarantee that the
 window will actually appear transparent on screen. On X11, this
 requires a compositing manager to be running. See
-gtk_widget_is_composited() for a way to find out if the alpha
+gdk_display_is_composited() for a way to find out if the alpha
 channel will be respected.
 </para>
 </answer>
index c3fa0067a7505255679ebafa688f1e257cf4230f..90df011290767d5687ee79a21baf0d7eb0c23791 100644 (file)
@@ -8843,31 +8843,6 @@ gtk_widget_propagate_screen_changed_recurse (GtkWidget *widget,
   g_object_unref (widget);
 }
 
-/**
- * gtk_widget_is_composited:
- * @widget: a #GtkWidget
- *
- * Whether @widget can rely on having its alpha channel
- * drawn correctly. On X11 this function returns whether a
- * compositing manager is running for @widget’s display.
- *
- * Returns: %TRUE if the widget can rely on its alpha
- * channel being drawn correctly.
- *
- * Since: 2.10
- */
-gboolean
-gtk_widget_is_composited (GtkWidget *widget)
-{
-  GdkDisplay *display;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
-  display = gtk_widget_get_display (widget);
-
-  return gdk_display_is_composited (display);
-}
-
 /**
  * _gtk_widget_propagate_screen_changed:
  * @widget: a #GtkWidget
@@ -14395,13 +14370,12 @@ gtk_widget_update_alpha (GtkWidget *widget)
  * are some limitations:
  *
  * For toplevel widgets this depends on the capabilities of the windowing
- * system. On X11 this has any effect only on X screens with a compositing manager
- * running. See gtk_widget_is_composited(). On Windows it should work
+ * system. On X11 this has any effect only on X displays with a compositing manager
+ * running. See gdk_display_is_composited(). On Windows it should work
  * always, although setting a window’s opacity after the window has been
  * shown causes it to flicker once on Windows.
  *
- * For child widgets it doesn’t work if any affected widget has a native window, or
- * disables double buffering.
+ * For child widgets it doesn’t work if any affected widget has a native window.
  *
  * Since: 3.8
  **/
index 20464576eb9a4c930535bc55d97f46701cf68c7f..b1ab5409a091f4da31e1379d26489848af46eaf1 100644 (file)
@@ -1109,10 +1109,6 @@ void             gtk_widget_set_default_direction (GtkTextDirection  dir);
 GDK_AVAILABLE_IN_ALL
 GtkTextDirection gtk_widget_get_default_direction (void);
 
-/* Compositing manager functionality */
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_widget_is_composited (GtkWidget *widget);
-
 /* Counterpart to gdk_window_shape_combine_region.
  */
 GDK_AVAILABLE_IN_ALL
index 5fbf6c8650c1f16c861d0dafec9de3e748794d02..beabc0c084857a522ec61c5660e9c0f50607d86d 100644 (file)
@@ -128,6 +128,7 @@ on_alpha_window_draw (GtkWidget *widget,
 {
   cairo_pattern_t *pattern;
   int radius, width, height;
+  GdkDisplay *display;
 
   /* Get the child allocation to avoid painting over the borders */
   GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
@@ -150,8 +151,9 @@ on_alpha_window_draw (GtkWidget *widget,
                                          height / 2,
                                         radius * 1.33);
 
-  if (gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)) &&
-      gtk_widget_is_composited (widget))
+  display = gtk_widget_get_display (widget);
+  if (gdk_display_is_rgba (display) &&
+      gdk_display_is_composited (display))
     cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.0); /* transparent */
   else
     cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* opaque white */